let Promise = require('./promise')

let p = new Promise((resolve, reject) => {
    // resolve(1)
    reject(1)
})

// 值的 穿透
// p.then(data => data).then(data => data).then(data => {
//     console.log('成功', data)
// })
// p.then(null, data => {
//     throw data
// }).then(null, data => {
//     throw data
// }).then(data => {
//     console.log('成功', data)
// })

p.then().then().then(data => {
    console.log('成功', data)
}, err => {
    console.log(err, 'err')
})
